//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.dstz.bpm.engine.listener;

import com.dstz.bpm.act.listener.ActEventListener;
import com.dstz.bpm.api.constant.EventType;
import com.dstz.bpm.api.constant.ScriptType;
import com.dstz.bpm.api.engine.action.cmd.InstanceActionCmd;
import com.dstz.bpm.api.engine.plugin.cmd.ExecutionCommand;
import javax.annotation.Resource;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.impl.ActivitiEntityEventImpl;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class AbstractInstanceListener implements ActEventListener {
   protected Logger LOG = LoggerFactory.getLogger(this.getClass());
   @Resource
   private ExecutionCommand aF;

   public AbstractInstanceListener() {
   }

   public abstract EventType getBeforeTriggerEventType();

   public abstract EventType getAfterTriggerEventType();

   public abstract void a(InstanceActionCmd var1);

   public abstract void b(InstanceActionCmd var1);

   public abstract void c(InstanceActionCmd var1);

   public void notify(ActivitiEvent event) {
      ActivitiEntityEventImpl processEvent = (ActivitiEntityEventImpl)event;
      ExecutionEntity excutionEntity = (ExecutionEntity)processEvent.getEntity();
      InstanceActionCmd actionModel = this.a(excutionEntity);
      this.a(actionModel);
      if (this.getBeforeTriggerEventType() != null) {
         this.aF.execute(this.getBeforeTriggerEventType(), actionModel);
      }

      this.b(actionModel);
      if (this.getAfterTriggerEventType() != null) {
         this.aF.execute(this.getAfterTriggerEventType(), actionModel);
      }

      this.c(actionModel);
   }

   protected abstract InstanceActionCmd a(ExecutionEntity var1);

   protected abstract ScriptType getScriptType();
}
